home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Tech Arsenal 1
/
Tech Arsenal (Arsenal Computer).ISO
/
tek-02
/
tspa2560.zip
/
TSUNTF.TST
< prev
next >
Wrap
Text File
|
1990-06-14
|
2KB
|
76 lines
(* This is a test program for the TSUNTF.TPU unit
All rights reserved 19-Aug-89
Updated 23-Sep-89, 21-Mar-90
*)
uses Dos,
Crt,
TSUNTF;
procedure LOGO;
begin
writeln;
writeln ('TSUNTF unit test by Prof. Timo Salmi, 21-Mar-90');
writeln ('University of Vaasa, Finland, ts@chyde.uwasa.fi');
writeln;
writeln ('....:....1....:....2....:....3....:....4....:....5....:....6....:....7....:....');
end; (* logo *)
(* Input line-editing *)
procedure TEST1;
var sj : string;
prompt : string;
tmp : string;
begin
prompt := 'Give your input> ';
FillChar (tmp, SizeOf(tmp), '.'); { If you are wondering about these two, }
tmp[0] := chr(Length(prompt)); { they just produce points to show where}
repeat { we are. }
EDRDLN (prompt, sj);
writeln (tmp, sj);
until sj = 'exit';
end; (* test1 *)
(* Iput line-editing with recall potential *)
procedure TEST2;
var sj : string;
old : string;
prompt : string;
tmp : string;
begin
prompt := 'Give your input> ';
old := '';
repeat
EDREADLN (prompt, old, sj);
writeln (sj);
old := sj;
until sj = 'exit';
end; (* test2 *)
(* Iput line-editing with recall and break potential *)
procedure TEST3;
var sj : string;
old : string;
prompt : string;
tmp : string;
BreakPressed : boolean;
begin
prompt := 'Give your input> ';
old := '';
repeat
EDREABLN (prompt, old, 79, sj, BreakPressed);
writeln (sj);
old := sj;
until BreakPressed; {Press ctrl-c or break}
writeln ('Break was pressed');
end; (* test3 *)
(* Main program *)
begin
ClrScr;
LOGO;
{ TEST1; }
{ TEST2; }
TEST3;
end. (* tsuntf.tst *)